#include <cstddef>

template <typename T>
class List{
    public:
        List():thesize(0){
            head = new Node();
            tail = new Node();
            head->next=tail;
            tail->prev=head;
        };
        List(const List & rhs){
            operator=(rhs);
        }
        const List & operator=(const List & rhs){
            if(this == &rhs){
                return *this;
            }
        }
        int size(){
            return size;
        }
        void push_back(const T & e){
                Node * p=new Node(e);
                tail->prev->next=p;
                p->prev=tail->prev;
                p->next=tail;
                tail->prev=p;
                thesize++;
        }
        struct Node{
            Node(const T & e):_e(e),next(NULL),prev(NULL){
            }
            Node():next(NULL),prev(NULL){}
            T _e;
            Node* prev;
            Node* next;
        };
        class const_iterator{
            public:
                const_iterator(Node *p):pNode(p){}
                const T & operator * (){
                    return pNode->_e;
                }
                void operator ++ (){
                    pNode=pNode->next;
                }
                void operator --(){
                    pNode=pNode->prev;
                }
                bool operator == (const const_iterator & rhs){
                    return pNode == rhs.pNode;
                }
                bool operator != (const const_iterator & rhs){
                    return pNode != rhs.pNode;
                }
            private:
                Node * pNode;
        };
        const_iterator begin(){
            return const_iterator(head->next);
        }
        const_iterator end(){
            return const_iterator(tail);
        }
    private:
        Node* head;
        Node* tail;
        int thesize;
};
